import 'lib.dart';

void main() {
  Man man = Man('Tom', 25, 1.7, '男');
  man.interduce();
  man.skill();
  man.sing();

  Woman woman = Woman('Jane', 23, 1.6, '女');
  woman.interduce();
  woman.skill();
  woman.like();
  woman.dance();
  woman.sing();

  Dancer dancer = Dancer('Jack', 20, 1.8, '男');
  dancer.interduce();
  dancer.dance();
}

// extends 继承
class Man extends Person with SingMixin {
  Man(super.name, super.age, super.height, super._gender);

  skill() {
    print('会开车');
  }

  // sing() {
  //   print('会唱歌');
  // }
}

class Woman extends Person with SingMixin, DanceMixin {
  Woman(super.name, super.age, super.height, super._gender);

  skill() {
    print('会化妆');
  }

  like() {
    print('喜欢购物');
  }

  // sing() {
  //   print('会唱歌');
  // }

  // dance() {
  //   print('会跳舞');
  // }
}

class Dancer extends Person with DanceMixin {
  Dancer(super.name, super.age, super.height, super._gender);

  // dance() {
  //   print('会跳舞');
  // }
}

// minxin 混入 抽离公共代码复用
mixin SingMixin {
  sing() {
    print('会唱歌');
  }
}

mixin DanceMixin {
  dance() {
    print('会跳舞');
  }
}
